<html>
<head><meta charset="utf-8"><title>format strings · t-compiler/const-eval · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/index.html">t-compiler/const-eval</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html">format strings</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="200260772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200260772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200260772">(Jun 09 2020 at 17:06)</a>:</h4>
<p>Would it be possible to evaluate format strings at compile time?</p>
<div class="codehilite"><pre><span></span><code><span class="n">println</span><span class="o">!</span><span class="p">(</span><span class="s">&quot;Hello there {}&quot;</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">);</span><span class="w"></span>
</code></pre></div>


<p>This could produce a single string.</p>



<a name="200264705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200264705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200264705">(Jun 09 2020 at 17:37)</a>:</h4>
<p>copy propagation would do that opportunistically</p>



<a name="200264756"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200264756" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200264756">(Jun 09 2020 at 17:37)</a>:</h4>
<p>it can't right now, but when we get const prop for <code>const fn</code> calls and make the formatting infrastructure <code>const fn</code>, then we'll be able to do that</p>



<a name="200264983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200264983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200264983">(Jun 09 2020 at 17:39)</a>:</h4>
<p>Does const prop have to care about whether a function is marked <code>const</code>?</p>



<a name="200266525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200266525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200266525">(Jun 09 2020 at 17:52)</a>:</h4>
<p>I assume that everyone pronounces that as "copprop"</p>



<a name="200266588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200266588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200266588">(Jun 09 2020 at 17:53)</a>:</h4>
<p>(assuming copy and const prop are two separate things?)</p>



<a name="200266606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200266606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200266606">(Jun 09 2020 at 17:53)</a>:</h4>
<p>const prop does have to care, because the mir interpreter will likely panic if you run it on non-const fns</p>



<a name="200266638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200266638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200266638">(Jun 09 2020 at 17:53)</a>:</h4>
<p>but the inliner could be more aggressive on functions where all arguments are const</p>



<a name="200266642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200266642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200266642">(Jun 09 2020 at 17:53)</a>:</h4>
<p>I mean, we run it on non-const fns now :)</p>



<a name="200266649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200266649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200266649">(Jun 09 2020 at 17:53)</a>:</h4>
<p>The ones we're optimizing</p>



<a name="200266666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200266666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200266666">(Jun 09 2020 at 17:53)</a>:</h4>
<p>I mean optimizing a function call</p>



<a name="200266675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200266675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200266675">(Jun 09 2020 at 17:54)</a>:</h4>
<p>not optimizing a function, that we do on all functions indeed</p>



<a name="200266772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200266772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200266772">(Jun 09 2020 at 17:54)</a>:</h4>
<p>I think the bigger issue is just that it probably won't actually be able to completely evaluate the call (if the fn isn't const) which will hurt compile times for no wins</p>



<a name="200266816"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200266816" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200266816">(Jun 09 2020 at 17:55)</a>:</h4>
<p>Rub a little more magic on, and I bet you can make this work: </p>
<div class="codehilite"><pre><span></span><code><span class="k">const</span><span class="w"> </span><span class="n">X</span>: <span class="kt">usize</span> <span class="o">=</span><span class="w"> </span><span class="n">format</span><span class="o">!</span><span class="p">(</span><span class="s">&quot;hello {} worlds&quot;</span><span class="p">,</span><span class="w"> </span><span class="mi">42</span><span class="p">).</span><span class="n">len</span><span class="p">();</span><span class="w"></span>
</code></pre></div>



<a name="200266828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200266828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200266828">(Jun 09 2020 at 17:55)</a>:</h4>
<p>that, too, but ppl may still want slow optimizations for specific cases</p>



<a name="200266889"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200266889" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200266889">(Jun 09 2020 at 17:55)</a>:</h4>
<p><span class="user-mention" data-user-id="116155">@Jake Goulding</span> that requires the exact same features and will work at the same time it works in const prop ;)</p>



<a name="200266898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200266898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200266898">(Jun 09 2020 at 17:55)</a>:</h4>
<p>but yea, I want that to work</p>



<a name="200266906"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200266906" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200266906">(Jun 09 2020 at 17:55)</a>:</h4>
<p>const eval truly is wonderful</p>



<a name="200266971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200266971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200266971">(Jun 09 2020 at 17:56)</a>:</h4>
<p>oh wait, there's a heap alloc in there... <code>format_args!(...)</code> will work with the same features</p>



<a name="200266988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200266988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200266988">(Jun 09 2020 at 17:56)</a>:</h4>
<blockquote>
<p>the exact same features </p>
</blockquote>
<p>yeah.</p>



<a name="200266991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200266991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200266991">(Jun 09 2020 at 17:56)</a>:</h4>
<p><code>format!</code> needs const heap, too :D</p>



<a name="200267015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200267015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200267015">(Jun 09 2020 at 17:56)</a>:</h4>
<p><em>whew</em> glad I wasn't missing something</p>



<a name="200267028"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200267028" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200267028">(Jun 09 2020 at 17:56)</a>:</h4>
<p>hehe</p>



<a name="200267067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200267067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200267067">(Jun 09 2020 at 17:57)</a>:</h4>
<p>const eval all the things^TM</p>



<a name="200267087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200267087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200267087">(Jun 09 2020 at 17:57)</a>:</h4>
<p>That's rather the goal, yeah?</p>



<a name="200267147"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200267147" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200267147">(Jun 09 2020 at 17:57)</a>:</h4>
<p>there's a bunch of things we know that we can't do</p>



<a name="200267180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200267180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200267180">(Jun 09 2020 at 17:57)</a>:</h4>
<p>not because it isn't possible impl wise, but it will cause undesirable behaviours</p>



<a name="200267223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200267223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200267223">(Jun 09 2020 at 17:58)</a>:</h4>
<p>we can't do threading</p>



<a name="200267235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200267235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200267235">(Jun 09 2020 at 17:58)</a>:</h4>
<p>for example</p>



<a name="200267287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200267287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200267287">(Jun 09 2020 at 17:58)</a>:</h4>
<p>Getting <code>format!</code> and <code>println!</code> to not produce such huge piles of code is one of my personal goals in terms of MIR optimizations.</p>



<a name="200267321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200267321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200267321">(Jun 09 2020 at 17:58)</a>:</h4>
<p>Might want to say "we choose not to" then, otherwise you'll get pedants like me trying to prove you wrong <span aria-label="innocent" class="emoji emoji-1f607" role="img" title="innocent">:innocent:</span></p>



<a name="200267345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200267345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200267345">(Jun 09 2020 at 17:59)</a>:</h4>
<p>It kills me how much MIR "hello world" generates.</p>



<a name="200267382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200267382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200267382">(Jun 09 2020 at 17:59)</a>:</h4>
<p><span class="user-mention" data-user-id="125250">@Wesley Wiser</span> And any such gains should help in embedded as well, I'd hope?</p>



<a name="200267400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200267400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200267400">(Jun 09 2020 at 17:59)</a>:</h4>
<p>I would think so</p>



<a name="200267429"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200267429" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200267429">(Jun 09 2020 at 17:59)</a>:</h4>
<p>And is that part of const-eval or "just" MIR optimizations?</p>



<a name="200267564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200267564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200267564">(Jun 09 2020 at 18:00)</a>:</h4>
<p>probably both</p>



<a name="200267608"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200267608" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200267608">(Jun 09 2020 at 18:00)</a>:</h4>
<p>stronger const eval means possibly stronger const prop</p>



<a name="200267651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200267651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200267651">(Jun 09 2020 at 18:01)</a>:</h4>
<p>but there's many things that will require independent MIR optimizations</p>



<a name="200267823"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200267823" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200267823">(Jun 09 2020 at 18:02)</a>:</h4>
<p>I really need to work more on the MIR inliner. Now that the LLVM upgrade happened, maybe it's worth retesting where we're at.</p>



<a name="200267835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200267835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200267835">(Jun 09 2020 at 18:02)</a>:</h4>
<p>Why didn't y'all just write it the fast way to start with :troll:</p>



<a name="200267871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200267871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200267871">(Jun 09 2020 at 18:03)</a>:</h4>
<p>Oh damn, why didn't we think of that? <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="200268089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200268089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200268089">(Jun 09 2020 at 18:05)</a>:</h4>
<p>For both const eval and polonius, I'm like "please happen soon" but I know that saying that doesn't help, so just know we all appreciate the work!</p>



<a name="200272557"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200272557" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200272557">(Jun 09 2020 at 18:41)</a>:</h4>
<p>we're reworking the way wg-const-eval works by giving us more autonomy in the small things by having an overarching plan that T-lang signs off on and frees them from the small questions</p>



<a name="200272627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200272627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200272627">(Jun 09 2020 at 18:42)</a>:</h4>
<p>but... alas... I have a thesis to finish, so I'm gonna do that right now :D</p>



<a name="200310690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200310690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200310690">(Jun 10 2020 at 01:20)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> how dare you work on something other than rust <span aria-label="rage" class="emoji emoji-1f621" role="img" title="rage">:rage:</span></p>



<a name="200310778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200310778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mark-i-m <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200310778">(Jun 10 2020 at 01:22)</a>:</h4>
<p>Seriously, though, I'm exactly with <span class="user-mention" data-user-id="116155">@Jake Goulding</span>: impatient for this awesome work to land... and then I remember it's all volunteer work, which is almost more awe-inspiring than the work itself</p>



<a name="200386295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200386295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200386295">(Jun 10 2020 at 07:41)</a>:</h4>
<p><span class="user-mention silent" data-user-id="198054">mark-i-m</span> <a href="#narrow/stream/146212-t-compiler.2Fconst-eval/topic/format.20strings/near/200310690">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="124288">oli</span> how dare you work on something other than rust <span aria-label="rage" class="emoji emoji-1f621" role="img" title="rage">:rage:</span></p>
</blockquote>
<p>The thesis is a lot about Rust, does that count? <span aria-label="grinning face with smiling eyes" class="emoji emoji-1f601" role="img" title="grinning face with smiling eyes">:grinning_face_with_smiling_eyes:</span></p>



<a name="200437482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200437482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200437482">(Jun 10 2020 at 16:06)</a>:</h4>
<p><span class="user-mention" data-user-id="116155">@Jake Goulding</span> you can figure out what you need to get a feature by looking at <a href="https://static.turbo.fish/const-eval-skill-tree/skill-tree.html">https://static.turbo.fish/const-eval-skill-tree/skill-tree.html</a> (thanks <span class="user-mention" data-user-id="198047">@jplatte</span> for hosting this!)</p>



<a name="200437560"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200437560" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200437560">(Jun 10 2020 at 16:06)</a>:</h4>
<p>most of these nodes are hyperlinks to the tracking issue of the feature</p>



<a name="200438783"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200438783" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200438783">(Jun 10 2020 at 16:14)</a>:</h4>
<p>Oh look at that. Format all the way over there at the edge.</p>



<a name="200438810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200438810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200438810">(Jun 10 2020 at 16:15)</a>:</h4>
<p>hehe</p>



<a name="200438843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200438843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200438843">(Jun 10 2020 at 16:15)</a>:</h4>
<p>serde would be a the same level</p>



<a name="200438907"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200438907" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200438907">(Jun 10 2020 at 16:15)</a>:</h4>
<p>hmm actually, just remembered there's some function pointer hackery in the formatting infrastructure</p>



<a name="200438923"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200438923" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200438923">(Jun 10 2020 at 16:15)</a>:</h4>
<p>serde is easier than <code>format!</code></p>



<a name="200439183"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200439183" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200439183">(Jun 10 2020 at 16:17)</a>:</h4>
<p>Things you don’t expect to hear every day.</p>



<a name="200516475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200516475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200516475">(Jun 11 2020 at 08:19)</a>:</h4>
<p>yeah... Miri can do <code>format!</code> but it's tricky</p>



<a name="200516532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200516532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200516532">(Jun 11 2020 at 08:20)</a>:</h4>
<p>I think the last bug where Miri actually executed programs incorrectly was in <code>format!</code>, because it relies on fn ptr equality in non-trivial ways</p>



<a name="200516562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/format%20strings/near/200516562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/format.20strings.html#200516562">(Jun 11 2020 at 08:20)</a>:</h4>
<p>on top of a lot of nasty unsafe code effectively implementing type erasure without using <code>dyn</code>^^</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>